package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TbMaliceMaMapper;
import com.ruoyi.system.domain.TbMaliceMa;
import com.ruoyi.system.service.ITbMaliceMaService;

/**
 * 恶意邮件Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-20
 */
@Service
public class TbMaliceMaServiceImpl implements ITbMaliceMaService 
{
    @Autowired
    private TbMaliceMaMapper tbMaliceMaMapper;

    /**
     * 查询恶意邮件
     * 
     * @param emailId 恶意邮件主键
     * @return 恶意邮件
     */
    @Override
    public TbMaliceMa selectTbMaliceMaByEmailId(Integer emailId)
    {
        return tbMaliceMaMapper.selectTbMaliceMaByEmailId(emailId);
    }

    /**
     * 查询恶意邮件列表
     * 
     * @param tbMaliceMa 恶意邮件
     * @return 恶意邮件
     */
    @Override
    public List<TbMaliceMa> selectTbMaliceMaList(TbMaliceMa tbMaliceMa)
    {
        return tbMaliceMaMapper.selectTbMaliceMaList(tbMaliceMa);
    }

    /**
     * 新增恶意邮件
     * 
     * @param tbMaliceMa 恶意邮件
     * @return 结果
     */
    @Override
    public int insertTbMaliceMa(TbMaliceMa tbMaliceMa)
    {
        tbMaliceMa.setCreateTime(DateUtils.getNowDate());
        return tbMaliceMaMapper.insertTbMaliceMa(tbMaliceMa);
    }

    /**
     * 修改恶意邮件
     * 
     * @param tbMaliceMa 恶意邮件
     * @return 结果
     */
    @Override
    public int updateTbMaliceMa(TbMaliceMa tbMaliceMa)
    {
        return tbMaliceMaMapper.updateTbMaliceMa(tbMaliceMa);
    }

    /**
     * 批量删除恶意邮件
     * 
     * @param emailIds 需要删除的恶意邮件主键
     * @return 结果
     */
    @Override
    public int deleteTbMaliceMaByEmailIds(Integer[] emailIds)
    {
        return tbMaliceMaMapper.deleteTbMaliceMaByEmailIds(emailIds);
    }

    /**
     * 删除恶意邮件信息
     * 
     * @param emailId 恶意邮件主键
     * @return 结果
     */
    @Override
    public int deleteTbMaliceMaByEmailId(Integer emailId)
    {
        return tbMaliceMaMapper.deleteTbMaliceMaByEmailId(emailId);
    }
}
